package ${packageName}.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

/**
 * ${tableComment}
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@SuperBuilder
@NoArgsConstructor
@TableName("${tableName}")
public class ${entityName} extends BaseDataEntity {

<#if columns??>
    <#list columns as column>
        <#if column.type='VARCHAR'||column.type='TEXT'||column.type='CHAR' ||column.type='LONGTEXT' || column.type='JSON'>
    /**
     * ${column.remark}
     */
            <#if column.isPrimary?? && column.isPrimary>
    @TableId("${column.columnName}")
            <#else>
    @TableField("${column.columnName}")
            </#if>
    private String ${column.propertyName?uncap_first};

        </#if>
        <#if column.type='INT' || column.type='TINYINT'>
    /**
     * ${column.remark}
     */
            <#if column.isPrimary?? && column.isPrimary>
    @TableId("${column.columnName}")
            <#else>
    @TableField("${column.columnName}")
            </#if>
    private Integer ${column.propertyName?uncap_first};

        </#if>
        <#if column.type='DATETIME'>
            <#if column.propertyName != 'CreateTime' && column.propertyName != 'UpdateTime'>
    /**
     * ${column.remark}
     */
    @TableField("${column.columnName}")
    private LocalDateTime ${column.propertyName?uncap_first};

            </#if>
        </#if>
        <#if column.type='BIGINT'>
            <#if column.propertyName != 'Id' && column.propertyName != 'UserId' && column.propertyName != 'ParentId' && column.propertyName != 'TopId' && column.propertyName != 'Creator' && column.propertyName != 'Updater'>
    /**
     * ${column.remark}
     */
                <#if column.isPrimary?? && column.isPrimary>
    @TableId("${column.columnName}")
                <#else>
    @TableField("${column.columnName}")
                </#if>
    private Long ${column.propertyName?uncap_first};

            </#if>
        </#if>
        <#if column.type='DOUBLE' || column.type='DECIMAL'>
    /**
     * ${column.remark}
     */
    @TableField("${column.columnName}")
    private BigDecimal ${column.propertyName?uncap_first};

        </#if>
        <#if column.type='BIT'>
            <#if column.propertyName != 'Deleted'>
    /**
     * ${column.remark}
     */
    @TableField("${column.columnName}")
    private Boolean ${column.propertyName?uncap_first};
            </#if>
        </#if>
    </#list>
</#if>
}